//
//  XYOAuthViewController.swift
//  SinaWeibo
//
//  Created by 韩啸宇 on 15/12/26.
//  Copyright © 2015年 backy. All rights reserved.
//

import UIKit

class XYOAuthViewController: UIViewController {

    /// 网页容器
    @IBOutlet weak var customWebView: UIWebView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        automaticallyAdjustsScrollViewInsets = false
        loadPage()
    }
    
    // MARK: - 内部控制方法
    private func loadPage() {
        
        // 创建URL
        guard let url = NSURL(string: "https://api.weibo.com/oauth2/authorize?client_id=3560036091&redirect_uri=https://www.baidu.com") else {
            XYLog("获取URL失败")
            return
        }
        
        // 创建请求
        let request = NSURLRequest(URL: url)
        
        // 加载网页
        customWebView.loadRequest(request)
    }

}
